<template>
  <div class="home">
    <Header @getNavId="childMsg"></Header>
    <section class="fakeBody">
      <!--首页-->
      <index v-show="navId == 1"></index>
      <!-- 教育要闻 -->
      <educationNews v-show="navId == 2"></educationNews>
      <!-- 网上办事 -->
      <onlineService v-show="navId == 4"></onlineService>
      <!-- 政民互动 -->
      <Interaction v-show="navId == 5"></Interaction>

    </section>
    <Footer></Footer>
  </div>
</template>
<script>
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import index from '@/components/index';
import educationNews from '@/components/educationNews';
import onlineService from '@/components/onlineService';
import Interaction from '@/components/Interaction';

export default {
  name: '',
  data () {
    return {
      navId: 1,
    }
  },
  created() {
  },
  mounted() {
    // this.langToggle()
  },
  methods: {
    langToggle(){
      // this.$i18n.locale = this.getLocalStorage('lang')
    },
    getLocalStorage(name) {
      if (window.localStorage.getItem(name) == null) {
        return '';
      } else {
        return window.localStorage.getItem(name);
      }
    },
    childMsg(id){
      this.navId = id
      console.log(this.navId)
    }
  },
  watch: {
  },
  components: {
    Header,
    Footer,
    index,
    educationNews,
    onlineService,
    Interaction,
  },
}
</script>
<style lang="scss" scoped>
.home{
  .fakeBody{
  }
}
</style>
